package com.bdq.user.infrastructure.persistence.mysql.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bdq.common.enums.YesOrNoEnum;
import com.bdq.user.infrastructure.persistence.mysql.mapper.UserMapper;
import com.bdq.user.infrastructure.persistence.mysql.service.UserService;
import com.bdq.user.infrastructure.persistence.mysql.pojo.User;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author malei
* @description 针对表【user(用户表)】的数据库操作Service实现
* @createDate 2024-05-04 09:38:04
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
    implements UserService {

    @Override
    public User getByUserMobile(String userMobile) {
        return lambdaQuery()
                .eq(User::getUserMobile, userMobile)
                .eq(User::getIsDeleted, YesOrNoEnum.NO.getCode())
                .one();
    }

    @Override
    public List<User> list(List<Long> userIds) {
        return lambdaQuery()
                .in(User::getId, userIds)
                .eq(User::getIsDeleted, YesOrNoEnum.NO.getCode())
                .list();
    }


}




